import requests

from base.env_config import ENV


class BaseLogin:
    def mer_login(self):
        url = ENV.MER_HOST + '/api/admin/merchant/login'
        headers = {'content-type': 'application/json',}

        json_data = {
            'account': ENV.MER_USERNAME,
            'pwd': ENV.MER_PASSWORD,
            'captchaVO': {},
            'captcha': {
                'captchaVerification': '',
                'secretKey': '',
                'token': '',
            },
        }
        return requests.post(url, json=json_data, headers=headers).json()['data']['token']

    def plat_login(self):
        pass

    def user_login(self):
        pass


if __name__ == '__main__':
    base_login = BaseLogin()
    response = base_login.mer_login()
    print(response)
